#ifndef GUI_CHECKBOX_H
#define GUI_CHECKBOX_H

#include <string>

//#include "BaseElement.h"
#include "gdn/GDN.h"

#define GUI_CHECKBOX_UNCHECKED 0
#define GUI_CHECKBOX_CHECKED   1

#define GUI_CHECKBOX_IDLE      2
#define GUI_CHECKBOX_ENTER     3
#define GUI_CHECKBOX_HOVER     4
#define GUI_CHECKBOX_EXIT      5
#define GUI_CHECKBOX_PRESS     6
#define GUI_CHECKBOX_HOLD      7
#define GUI_CHECKBOX_RELEASE   8

namespace gui
{
	class Checkbox //: BaseElement
	{
		public:
			Checkbox();
			Checkbox( const gdn::Vector2f& thePos, bool theCurrentState,
					  gdn::Image& theImageSet,
					  const gdn::Rectanglei& theRectUncheckedIdle, const gdn::Rectanglei& theRectUncheckedHover, const gdn::Rectanglei& theRectUncheckedPress,
					  const gdn::Rectanglei& theRectCheckedIdle, const gdn::Rectanglei& theRectCheckedHover, const gdn::Rectanglei& theRectCheckedPress );

			virtual int  Process( const gdn::Event& event );
			virtual void Draw( gdn::Window& window );
			virtual void Draw( gdn::RenderImage& renderImage );

			virtual bool IsChecked() const;

		protected:
			gdn::Vector2f pos;
			gdn::Vector2f mousePos;

			gdn::Image* imageSet;

			gdn::Rectanglei rectUncheckedIdle;
			gdn::Rectanglei rectUncheckedHover;
			gdn::Rectanglei rectUncheckedPress;
			gdn::Rectanglei rectCheckedIdle;
			gdn::Rectanglei rectCheckedHover;
			gdn::Rectanglei rectCheckedPress;

			gdn::Sprite checkboxSprite;
			gdn::Rectanglei* activeRect;

			bool hold;
			int currentState;

			void Toggle();
	};
}

#endif // GUI_CHECKBOX_H

